<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Remark
 *
 * @author wupeng
 */
class Application_Model_Remark extends Application_Model_DomainObject{
    //put your code here
    
    protected $_id; 
    protected $_remarkType; 
    protected $_content; 
    protected $_operator; 
    protected $_objectId; 
    protected $_objectType; 
    protected $_createdAt; 
    
    /*
     * 内部备注
     */
    const REMARKTYPE_INTERIOR = 1; //内部备注
    /*
     * 国际运单备注 
     */
    const OBJECT_WAYBILL_TYPE = 1;
    /**
     * 上门取件备注
     */
    const OBJECT_VISITING_TYPE = 2;
    
    
    public function getObjectRemark($objId,$objType = self::OBJECT_WAYBILL_TYPE,$remarkType = self::REMARKTYPE_INTERIOR){
        $where = array('remarkType'=>$remarkType,'objectType'=>$objType,'objectId'=>$objId);
        return Application_Model_Remark::getDao()->queryAll($where);
    }
    
    public function getObjectSimpleRemark($objId,$objType = self::OBJECT_WAYBILL_TYPE,$remarkType = self::REMARKTYPE_INTERIOR){
        $where = array('remarkType'=>$remarkType,'objectType'=>$objType,'objectId'=>$objId);
        return Application_Model_Remark::getDao()->queryOne($where);
    }
}
